using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;


namespace JumpyCat.bamboo
{
    public class SimpleSoundManager
    {
        public SoundEffect catSound;
        public SoundEffect touchCatSound;
        public SoundEffect touchSound;

        public static SoundEffectInstance catSoundInstance;
        public static SoundEffectInstance touchCatSoundInstance;
        public static SoundEffectInstance touchSoundInstance;

        public static bool isMuted = false;


        public SimpleSoundManager(ContentManager content)
        {
            catSound = content.Load<SoundEffect>(PathResource.CAT_SOUND);
            touchCatSound = content.Load<SoundEffect>(PathResource.TOUCH_CAT_SOUND);
            touchSound = content.Load<SoundEffect>(PathResource.CLICK_SOUND);

            catSoundInstance = catSound.CreateInstance();
            touchCatSoundInstance = touchCatSound.CreateInstance();
            touchSoundInstance = touchSound.CreateInstance();

        }

        public static void PlayCatSound()
        {
            if (isMuted)
            {
                return;
            }
            catSoundInstance.Play();
        }

        public static void PlayClickSound()
        {
            if (isMuted)
            {
                return;
            }
            touchSoundInstance.Play();
        }

        public static void PlayTouchCatSound()
        {
            if (isMuted)
            {
                return;
            }
            touchCatSoundInstance.Play();
        }


        public static void StopPlayMusic()
        {
            catSoundInstance.Stop();
            touchCatSoundInstance.Stop();
            touchSoundInstance.Stop();

        }
    }
}
